#include <algo.h>
#include <vector.h>

/*
   This is a small demo program for the use of the c++ standard template library,
   taken and modified from an article in Dr Dobbs 6 '96. It reads numbers from stdin
   until a non-number is entered, stores them in a vector, sorts the numbers and 
   writes the sorted vector to stdout.
*/

void main () {
   vector<int> numbers;

   copy (istream_iterator<int>(cin), istream_iterator<int>(), inserter(numbers, numbers.end()));
   sort (numbers.begin(), numbers.end());
   copy (numbers.begin(), numbers.end(), ostream_iterator<int>(cout));
}
